<template>
  <div class="login">
    <div class="logo">
      <img src="http://xl.9yuecloud.com/assets/img/login.a4c656a9.png" alt="" />
    </div>
    <div class="form">
      <van-form @submit="onSubmit">
        <van-field
          v-model="dataList.mobile"
          name="用户名"
          label="用户名"
          placeholder="用户名"
          :rules="[{ required: true, message: '请填写用户名' }]"
        />
        <van-field
          v-model="dataList.password"
          type="password"
          name="密码"
          label="密码"
          placeholder="密码"
          :rules="[{ required: true, message: '请填写密码' }]"
        />
        <div class="others">
          <span class="forget">找回密码</span
          ><span class="login_CAPTCHA" @click="$router.push('/yzlogin')">注册/验证码登录</span>
        </div>
        <div style="margin: 16px">
          <van-button round block type="info" native-type="submit" @click="btn"
            >提交</van-button
          >
        </div>

        <div class="otherLogin">
          第三方登录
          <div class="txLogin">
            <div class="wxLogin">
              <img
                src=""
              /><span>微信登录</span>
            </div>
            <div class="qqLogin">
              <img
                src=""
                alt=""
              /><span>QQ登录</span>
            </div>
          </div>
        </div>
      </van-form>

      <!-- <form class="van-form">
        <div>
          <div>
            <span>用户名</span>
          </div>
          <div>
            <div>
              <input
                type="text"
                name="用户名"
                placeholder="用户名"
                v-model="dataList.username"
                class="van-field__control"
              />
            </div>
            <div>请填写用户名</div>
          </div>
        </div>
        <div>
          <div><span>密码</span></div>
          <div>
            <div>
              <input
                type="password"
                name="密码"
                placeholder="密码"
                v-model="dataList.password"
                class="van-field__control"
              />
            </div>
          </div>
        </div>
        
        <div class="btn">
          <button
            type="submit"
            class="
              van-button
              van-button--info
              van-button--normal
              van-button--block
              van-button--round
            "
            style="
              color: rgb(255, 255, 255);
              background: rgb(253, 102, 20);
              border-color: rgb(253, 102, 20);
            "
          >
            <div class="van-button__content">
              <span class="van-button__text">登录</span>
            </div>
          </button>
        </div>
      </form> -->
    </div>
  </div>
</template>
  
  <script>
    import { login } from '../request/http'
export default {
  data() {
    return {
      dataList: {
        mobile: "17326909271",
        password: "wang1230.0",
        type:1
      },
    };
  },
  methods: {
    btn(){
      login(this.dataList).then(res=>{
        console.log(res);
        if(res.data.code == 200){
          localStorage.setItem('token',res.data.data.remember_token)
          this.$router.push('/my')
        }
      })
    },
    onSubmit(values) {
      console.log("submit", values);
    },
  },
};
</script>
  
  <style scoped lang="scss">
.login {
  height: 100vh;
  background-color: #fff;
  overflow: auto;
}
.logo {
  font-size: 12px;
  width: 70%;
  height: 1.36rem;
  margin: 1.6rem auto;
  background-color: #fff;
  box-sizing: border-box;
  img {
    width: 100%;
  }
}
.form {
  font-size: 12px;
  width: 83%;
  margin: 0 auto;
  .others {
    width: 90%;
    display: flex;
    margin: 0.133rem auto;
    justify-content: space-between;
  }
  .btn {
    margin-top: 1.333rem;
  }
  .otherLogin {
    width: 95%;
    margin: 0.533rem auto;
    text-align: center;
    .txLogin {
      display: flex;
      margin-top: 0.8rem;
      img {
        width: 1.013rem;
        height: 0.747rem;
        margin-right: 0.533rem;
      }
      span {
        font-size: 0.4rem;
        font-family: PingFangSC-Regular;
        font-weight: 400;
        color: #8c8c8c;
      }
      .wxLogin,
      .qqLogin {
        width: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
      }
      .wxLogin {
        border-right: 1px solid #f1f1f1;
      }
    }
  }
}
</style>